package com.donkey.http;

import java.io.File;
import java.io.IOException;
import java.io.OutputStream;
import java.nio.charset.Charset;
import java.util.Map;

public class HttpHelper {
    static Http http = new Http();

    public static String get(String url,
                             Map<String, String> requestHeaders,
                             Map<String, String> parameters) throws IOException {
        return http.get(url, requestHeaders, parameters);
    }

    public static String get(String url,
                             Map<String, String> requestHeaders,
                             Map<String, String> parameters,
                             Charset inputCharset,
                             Map<String, String> responseHeaders,
                             Charset outputCharset) throws IOException {
        return http.get(url, requestHeaders, parameters, inputCharset, responseHeaders, outputCharset);
    }

    public static String get(String url) throws IOException {
        return http.get(url);
    }

    public static String get(String url,
                             Map<String, String> requestHeaders,
                             String queryString) throws IOException {
        return http.get(url, requestHeaders, queryString);
    }

    public static String get(String url,
                             Map<String, String> requestHeaders,
                             String queryString,
                             Map<String, String> responseHeaders,
                             Charset outputCharset) throws IOException {
        return http.get(url, requestHeaders, queryString, responseHeaders, outputCharset);
    }

    public static void get(String url,
                           Map<String, String> requestHeaders,
                           Map<String, String> parameters,
                           Charset inputCharset,
                           Map<String, String> responseHeaders,
                           OutputStream outputStream) throws IOException {
        http.get(url, requestHeaders, parameters, inputCharset, responseHeaders, outputStream);
    }

    public static void get(String url,
                           Map<String, String> requestHeaders,
                           String queryString,
                           Map<String, String> responseHeaders,
                           OutputStream outputStream) throws IOException {
        http.get(url, requestHeaders, queryString, responseHeaders, outputStream);
    }

    public static String post(String url,
                              Map<String, String> requestHeaders,
                              String content) throws IOException {
        return http.post(url, requestHeaders, content);
    }

    public static String post(String url,
                              Map<String, String> requestHeaders,
                              String content,
                              Charset inputCharset,
                              Map<String, String> responseHeaders,
                              Charset outputCharset) throws IOException {
        return http.post(url, requestHeaders, content, inputCharset, responseHeaders, outputCharset);
    }

    public static String post(String url,
                              Map<String, String> requestHeaders,
                              Map<String, String> parameters) throws IOException {
        return http.post(url, requestHeaders, parameters);
    }

    public static String post(String url,
                              Map<String, String> requestHeaders,
                              Map<String, String> parameters,
                              Charset inputCharset,
                              Map<String, String> responseHeaders,
                              Charset outputCharset) throws IOException {
        return http.post(url, requestHeaders, parameters, inputCharset, responseHeaders, outputCharset);
    }

    public static void post(String url,
                            Map<String, String> requestHeaders,
                            String content,
                            Charset charset,
                            Map<String, String> responseHeaders,
                            OutputStream outputStream) throws IOException {
        http.post(url, requestHeaders, content, charset, responseHeaders, outputStream);
    }

    public static void post(String url,
                            Map<String, String> requestHeaders,
                            Map<String, String> parameters,
                            Charset charset,
                            Map<String, String> responseHeaders,
                            OutputStream outputStream) throws IOException {
        http.post(url, requestHeaders, parameters, charset, responseHeaders, outputStream);
    }

    public static String upload(String url,
                                Map<String, String> requestHeaders,
                                Map<String, String> parameters,
                                Map<String, File> files) throws IOException {
        return http.upload(url, requestHeaders, parameters, files);
    }

    public static String upload(String url,
                                Map<String, String> requestHeaders,
                                Map<String, String> parameters,
                                Map<String, File> files,
                                Charset inputCharset,
                                Map<String, String> responseHeaders,
                                Charset outputCharset) throws IOException {
        return http.upload(url, requestHeaders, parameters, files, inputCharset, responseHeaders, outputCharset);
    }

    public static void shutdown() {
        http.shutdown();
    }
}
